local sk__huoshi = fk.CreateSkill {

  name = "sk__huoshi",

  tags = { Skill.Compulsory, },

}



sk__huoshi:addEffect(fk.AfterCardTargetDeclared, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sk__huoshi.name) and target ~= player and
      (data.card.type == Card.TypeBasic or data.card:isCommonTrick()) and data.tos and
      (#data:getExtraTargets() > 0 or
      (not table.contains(data.tos, target) and not target:isProhibited(target, data.card)))
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local targets = data:getExtraTargets()
    if not table.contains(data.tos, target) and not target:isProhibited(target, data.card) then
      table.insert(targets, target)
    end
    local to = table.random(targets)
    room:doIndicate(target.id, {to})
    data:addTarget(to)
  end,
})

return sk__huoshi